﻿CREATE TABLE DBDictionary.DBMarket(
		ID							uniqueidentifier PRIMARY KEY,
		DBDictionaryID				uniqueidentifier NOT NULL,
		Name						varchar(255),

	    --//
        --// Orders can be entered, modified, and deleted.No trades occur.
        --//
        PreOpeningStart time NOT NULL,
        PreOpeningStop time NOT NULL,
        
        --//
        --// During the opening, the uncrossing of the current orders takes place. At this time, orders cannot be entered, modified, or deleted.
        --//
        OpeningStart time NOT NULL,
        OpeningStop time NOT NULL,

        --//
        --// Orders can be entered, modified, and deleted. Trades continuously occur as orders match at price/time priority
        --//
        ContinuousTradingStart time NOT NULL,
        ContinuousTradingStop time NOT NULL,

        --//
        --// Orders can be entered, modified, and deleted. No trades occur. Please note the auction has a random ending time.
        --//
        IntradayAuctionStart time NOT NULL,
        IntradayAuctionStop time NOT NULL,

        --//
        --// Orders can be entered, modified, and deleted.No trades occur.
        --//
        PreClosingStart time NOT NULL,
        PreClosingStop time NOT NULL,

        --//
        --// The closing match is performed.
        --//
        ClosingStart time NOT NULL,
        ClosingStop time NOT NULL,
	
		FOREIGN KEY(DBDictionaryID)	REFERENCES DBDictionary.DBDictionary(ID) ON DELETE CASCADE,
		
		UNIQUE(Name,DBDictionaryID),
		
		_InsertionStamp							bigint,
		_UpdateStamp							bigint,
);
